{extend name="../../admin/view/public/admin"}

{block name='content'}

<div class="page-header">
    当前位置：<span class="text-primary">{if !empty($item)}编辑{else}新建{/if}表单
    	<small>{if !empty($item)}(名称: {$item['company']}){/if}</small>
    </span>
</div>

<div class="page-content">

    <form action="" method="post" class="form-validate form-horizontal ">
        <input type="hidden" name="id" value="{$item['id']}"/>

        <div class="form-group">
            <label class="col-lg control-label must">排序</label>
            <div class="col-sm-9 col-xs-12">
                <input type="text" name="displayorder" class="form-control" value="{:intval($item['displayorder'])}" data-rule-required='true'/>
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg control-label must">表单名称</label>
            <div class="col-sm-9 col-xs-12">
                <input type="text" name="name" class="form-control" value="{$item['name']}" data-rule-required='true'/>
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg control-label">选择日期</label>
            <div class="col-sm-9 col-xs-12">
                {:tpl_form_field_date('date_time',$item['date_time'])}
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg control-label">选择日期时间段</label>
            <div class="col-sm-9 col-xs-12">
                {:tpl_form_field_daterange('time', array('sm'=>true, 'placeholder'=>'购买时间'),true)}
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg control-label">选择年月日</label>
            <div class="col-sm-9 col-xs-12">
                {:tpl_form_field_calendar('birthday',$birthday)}
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg control-label">选择时钟</label>
            <div class="col-sm-9 col-xs-12">
                {:tpl_form_field_clock('time_str',$item['time_str'])}
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg control-label">选择地址</label>
            <div class="col-sm-9 col-xs-12">
                {:tpl_form_field_district('address', $address)}
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg control-label must">区域选择</label>
            <div class="col-sm-9 col-xs-12">
                <div id="areas" class="form-control-static">{$item['areas']?$item['areas']:'暂无'}</div>
                <a href="javascript:;" class="btn btn-default" onclick="selectAreas()">选择区域</a>
                <input type="hidden" id='selectedareas' name="areas" value="{$item['areas']}"/>
                <input type="hidden" id='selectedareas_code' name="areas_code" value="{$item['areas_code']}"/>
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg control-label">选择颜色</label>
            <div class="col-sm-9 col-xs-12">
                {:tpl_form_field_color('color',$item['color'])}
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg control-label">单图样式一</label>
            <div class="col-sm-9 col-xs-12">
                {:tpl_form_field_image('thumb', $item['thumb'])}
                <span class="help-block">可以展示历史图片，点击图片可删除</span>
            </div>
        </div>
        <div class="form-group">
            <label class="col-lg control-label">单图样式二</label>
            <div class="col-sm-9 col-xs-12">
                {:tpl_form_field_image2('thumb2', $item['thumb2'])}
                <span class="help-block">无历史图片</span>
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg control-label">多图样式一</label>
            <div class="col-sm-9 col-xs-12">
                {:tpl_form_field_multi_image('thumbs', $item['thumbs'])}
                <span class="help-block">可以展示历史图片，点击图片可删除</span>
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg control-label">多图样式二</label>
            <div class="col-sm-9 col-xs-12">
                {:tpl_form_field_multi_image2('thumbs2', $item['thumbs2'])}
                <span class="help-block">无历史图片，可进行排序显示</span>
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg control-label">选择视频</label>
            <div class="col-sm-9 col-xs-12">
                {:tpl_form_field_video2('video_url', $item['video_url'])}
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg control-label">选择音频</label>
            <div class="col-sm-9 col-xs-12">
                {:tpl_form_field_audio('audio_url', $item['audio_url'])}
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg control-label">单数据选择器</label>
            <div class="col-sm-9 col-xs-12">
                {:tpl_selector('data_id',array('text'=>'name','preview'=>true,'type'=>'image', 'required'=>false,  'thumb'=>'logo','placeholder'=>'名称','buttontext'=>'选择数据', 'items'=>$accountInfo,'url'=>webUrl('form.module/query')))}
                <span class="help-block">在模态框进行选择数据信息</span>
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg control-label">富文本编辑器</label>
            <div class="col-sm-9 col-xs-12">
                {:tpl_ueditor('content',$item['content'],array('height'=>'300'))}
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg control-label">坐标选择器</label>
            <div class="col-sm-9 col-xs-12">
                {:tpl_form_field_position('map',array('lng'=>$item['longitude'],'lat'=>$item['latitude']))}
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg control-label">自定义模态框</label>
            <div class="col-sm-9 col-xs-12">
                <div class="input-group">
                    <input type="text" name="" class="form-control" value=""/>
                    <span class="input-group-addon btn-default" data-href="{:webUrl('form.module/model')}" data-toggle="ajaxModal">打开模态框</span>
                </div>
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg control-label"></label>
            <div class="col-sm-9">
                <input type="hidden" name="backUrl" value="{:webUrl('form.module/main')}">
                <input type="submit" class="btn btn-primary" value="保存">
                <a class="btn btn-default" href="{:webUrl('form.module/main')}">返回列表</a>
            </div>
        </div>

    </form>
</div>


{include file="../app/admin/view/public/form/selectareasNew.html" /}

{/block}